package com.nf.xiaomi.web.controller;

import com.nf.mvc.ViewResult;
import com.nf.mvc.mapping.RequestMapping;
import com.nf.mvc.support.ResponseVO;
import com.nf.xiaomi.entity.CategoryEntity;
import com.nf.xiaomi.service.CategoryService;
import com.nf.xiaomi.service.impl.CategoryServiceImpl;

import java.util.List;

import static com.nf.mvc.handler.HandlerHelper.json;

@RequestMapping("/category")
public class CategoryController {
    CategoryService service = new CategoryServiceImpl();
    @RequestMapping("/getAll")
    public ViewResult getAll() {
        List<CategoryEntity> list =  service.getAll();
        return json(new ResponseVO(200, "ok", list));
    }
}
